import React, { useState, useEffect, ReactElement } from 'react'
import { Button, Drawer, Form, Input, Tree } from 'antd';
export default function index(props) {
 
    useEffect(()=>{
        console.log("props",props);
    },[])
  
    return (
        <Drawer closable={false} title="修改角色" placement="right" onClose={props.onClose} visible={props.visible}>
            <Form  {...props.layout} name="nest-messages" onFinish={props.onFinish} validateMessages={props.validateMessages}>
                <Form.Item name={['roleName1']} label="角色名称:">
                    <Input type="text" onChange={(event) => props.roleName11(event.target.value)} defaultValue={props.roleName1} value={props.roleName1} />
                    {/* <Input         onChange={(event) => setchargename(event.target.value)} value={chagrename}></Input> */}
                </Form.Item>
                <Form.Item name={['userRemark1']} label="角色描述:">
                    <Input.TextArea onChange={(event) => props.userRemark11(event.target.value)} defaultValue={props.userRemark1} value={props.userRemark1} />
                </Form.Item>
                <Form.Item name={['treeData']} label="权限选择:">
                    <Tree
                        onSelect={props.onSelect}
                        checkable
                        onCheck={props.onCheck}
                        defaultExpandedKeys={props.usreMenu}
                        defaultCheckedKeys={props.usreMenu}
                        treeData={props.treeData}
                    />
                </Form.Item>
                <Form.Item wrapperCol={{ ...props.layout.wrapperCol, offset: 8 }}>
                    <Button type="primary" htmlType="submit">
                       提交
                    </Button>
                </Form.Item>
            </Form>
        </Drawer>
    )
}
